package com.pitaya.avatar.util;

import com.pitaya.avatar.domain.School;

public class SchoolMatcher {
	public static boolean update(School schoolOld,School schoolNew) {
		if(schoolOld == null || schoolNew == null) {
			return false;
		}
		if(schoolOld == schoolNew) {
			return true;
		}
		
		if(schoolOld.getLongitude() != schoolNew.getLongitude()) {
			schoolOld.setLongitude(schoolNew.getLongitude());
			
		}
		
		if(schoolOld.getLatitude() != schoolNew.getLatitude()) {
			schoolOld.setLatitude(schoolNew.getLatitude());
		}
		
		if(schoolOld.getName().equals(schoolNew.getName()) == false) {
			schoolOld.setName(schoolNew.getName());
		}
		
		if(schoolOld.getLetters().equals(schoolNew.getLetters()) == false) {
			schoolOld.setLetters(schoolNew.getLetters());
		}
		
		
		
		if(schoolOld.getSid().equals(schoolNew.getSid()) == false) {
			schoolOld.setSid(schoolNew.getSid());
		}
		
		if(schoolOld.getCalendar().equals(schoolNew.getCalendar()) == false) {
			schoolOld.setCalendar(schoolNew.getCalendar());
		}
		
		return true;
	}
}
